﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using Widget.Lib;

namespace Widget.Account
{
    public partial class APIKey : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (User.Identity.IsAuthenticated)
                {
                    txtUserName.Text = User.Identity.Name;
                    txtEmail.Text = Membership.GetUser().Email;
                }
            }
        }

        protected void btnGet_Click(object sender, EventArgs e)
        {
            txtAPI.Text = WebEncrypter.Login.GetToken(txtUserName.Text, txtEmail.Text, Session.LCID);
        }
    }
}